package com.taotao.adapter.controller;


import com.taotao.adapter.controller.impl.AnnotationController;
import com.taotao.adapter.controller.impl.ImplController;
import com.taotao.adapter.controller.impl.RequestHandlerController;

/**
 * @author 余胜军
 * @ClassName AdapterInvok
 * @qq 644064779
 * @addres www.mayikt.com
 * 微信:yushengjun644
 */
public class AdapterInvok {
    public static void invok(Controller controller) {
        if (controller instanceof AnnotationController) {
            AnnotationController annotationController = (AnnotationController) controller;
            annotationController.handleRequest();
            return;
        }
        if (controller instanceof ImplController) {
            ImplController implController = (ImplController) controller;
            implController.handleRequest();
        }
        if (controller instanceof RequestHandlerController) {
            RequestHandlerController requestHandlerController = (RequestHandlerController) controller;
            requestHandlerController.requestHandler();
        }
        
    }

    public static void main(String[] args) {
        AdapterInvok.invok(new ImplController());
    }
}
